#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：partial_codes-master 
@File ：simple_msg_sender.py
@IDE  ：PyCharm 
@Author ：李涵彬
@Date ：2024/2/23 23:51 
"""

"""
简单发送报文程序
"""

import socket

HOST = '127.0.0.1'
PORT = 65432


def build_type_a_message():
	"""构建A类型报文"""
	# 构建A类型报文的逻辑
	return msg


def build_type_b_message():
	"""构建B类型报文"""
	# 构建B类型报文的逻辑
	return msg


with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
	s.connect((HOST, PORT))
	while True:
		# 构建不同类型的报文
		msg_type = input("Input message type to send: ")
		if msg_type == "A":
			msg = build_type_a_message()
		elif msg_type == "B":
			msg = build_type_b_message()

		# 发送报文
		s.sendall(msg.encode())
